const Websocket = require('ws');

const ws = new Websocket('ws://127.0.0.1:13998');

const msg = {
    HEAD : {
        tag : "MESG",
        version : 65537,
        record_type : "GENERAL_RETURN",
        record_subtype : "STRING",
        record_num : 1,
        expand_num : 0,
        nonce: ''
    },
    RECORD : [
        {"name":"ENUM","return_value":"elem_basetype"}
    ],
    EXPAND : []
}

let jsonString = JSON.stringify(msg);

ws.on('open', function open() {
    ws.send(jsonString);
});

ws.on('message', function incoming(message) {
    console.log('收到' + message);
});

